package com.tianqu.tms.core.util.enums;

/**
 * @author HuangWei
 *
 */
public enum WeChatResultCode {
	SUCCESS                        (1000, "成功"),
	ERROR_1001                     (1001, "参数为空"),
	ERROR_1002                     (1002, "系统错误"),
	ERROR_1003                     (1003, "数据库操作失败"),
	ERROR_1004                     (1004, "请求超时"),
	ERROR_1005                     (1005, "参数不合法"),
	ERROR_1006                     (1006, "未知异常"),
	//
	ERROR_2000                     (2000, "添加车辆失败"),
	ERROR_2001                     (2001, "车辆编号已存在"),
	ERROR_2002                     (2002, "车牌号码已存在"),
	ERROR_2003                     (2003, "车辆编号不存在"),
	ERROR_2004                     (2004, "库存状态：编号非法"),
	ERROR_2005                     (2005, "库存状态：状态已修改"),
	ERROR_2006                     (2006, "库存状态：修改失败"),
	ERROR_2007                     (2007, "数据不符：会员id"),
	
	//
	ERROR_3000                     (3000, "新增过户车辆失败"),
	ERROR_3001                     (3001, "过户流水号已存在"),
	
	//
	ERROR_4000                     (4000, "会员/经办人已存在"),
	ERROR_4001                     (4001, "会员/经办人添加失败"),
	ERROR_4002                     (4002, "会员/经办人不存在"),
	ERROR_4003                     (4003, "会员/经办人修改信息失败"),
	ERROR_4004                     (4004, "会员类别不存在"),
	ERROR_4005                     (4005, "积分操作类型非法"),
	//
	ERROR_5000                     (5000, "上传图片不存在或格式不正确"),
	ERROR_5001                     (5001, "上传图片不完整"),
	ERROR_5002                     (5002, "图片保存失败"),
	//
	
	ERROR_6001                     (6001, "支付方商户会员不存在"),
	ERROR_6002                     (6002, "支付方经办人会员不存在"),
	ERROR_6003                     (6003, "接收方商户会员不存在"),
	ERROR_6004                     (6004, "接收方经办人会员不存在"),
	
	ERROR_7001                     (7001, "过户信息不存在"),
    //
	ERROR_8001                     (8001, "过户信息不存在");
	;
	//
	
	
	
	private final int value;
	private final String message;
	
	/**
	 * 
	 */
	WeChatResultCode(int value, String displayName) {
		this.value = value;
		this.message = displayName;
	}
	
	/**
	 * 
	 */
	public static WeChatResultCode getResultCode(int value) {
		 if(value == WeChatResultCode.SUCCESS.getValue()) return WeChatResultCode.SUCCESS;
		 else if(value == WeChatResultCode.ERROR_1001.getValue()) return WeChatResultCode.ERROR_1001;
		 else if(value == WeChatResultCode.ERROR_1002.getValue()) return WeChatResultCode.ERROR_1002;
		 else if(value == WeChatResultCode.ERROR_1003.getValue()) return WeChatResultCode.ERROR_1003;
		 else if(value == WeChatResultCode.ERROR_1004.getValue()) return WeChatResultCode.ERROR_1004;
		 else if(value == WeChatResultCode.ERROR_2000.getValue()) return WeChatResultCode.ERROR_2000;
		 else if(value == WeChatResultCode.ERROR_2001.getValue()) return WeChatResultCode.ERROR_2001;
		 else if(value == WeChatResultCode.ERROR_2002.getValue()) return WeChatResultCode.ERROR_2002;
		 else if(value == WeChatResultCode.ERROR_2003.getValue()) return WeChatResultCode.ERROR_2003;
		 else if(value == WeChatResultCode.ERROR_2004.getValue()) return WeChatResultCode.ERROR_2004;
		 else if(value == WeChatResultCode.ERROR_2005.getValue()) return WeChatResultCode.ERROR_2005;
		 else if(value == WeChatResultCode.ERROR_2006.getValue()) return WeChatResultCode.ERROR_2006;
		 else if(value == WeChatResultCode.ERROR_2007.getValue()) return WeChatResultCode.ERROR_2007;
		 else if(value == WeChatResultCode.ERROR_3000.getValue()) return WeChatResultCode.ERROR_3000;
		 else if(value == WeChatResultCode.ERROR_3001.getValue()) return WeChatResultCode.ERROR_3001;
		 else if(value == WeChatResultCode.ERROR_4000.getValue()) return WeChatResultCode.ERROR_4000;
		 else if(value == WeChatResultCode.ERROR_4001.getValue()) return WeChatResultCode.ERROR_4001;
		 else if(value == WeChatResultCode.ERROR_4002.getValue()) return WeChatResultCode.ERROR_4002;
		 else if(value == WeChatResultCode.ERROR_4003.getValue()) return WeChatResultCode.ERROR_4003;
		 else if(value == WeChatResultCode.ERROR_4004.getValue()) return WeChatResultCode.ERROR_4004;
		 else if(value == WeChatResultCode.ERROR_4005.getValue()) return WeChatResultCode.ERROR_4005;
		 else if(value == WeChatResultCode.ERROR_7001.getValue()) return WeChatResultCode.ERROR_7001;
		 else if(value == WeChatResultCode.ERROR_8001.getValue()) return WeChatResultCode.ERROR_8001;
		 else return WeChatResultCode.ERROR_1006;
	}
	
	/**
	 * 
	 */
	public int getValue() {
		return this.value;
	}
	
	public String getMessage() {
		return this.message;
	}
}
